<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/common.css">
<title>Insert title here</title>
</head>
<body>
	<script type="text/javascript" src="/js/discuss.js" charset="UTF-8"></script>
	<link rel="stylesheet" href="/css/looktable.css" type="text/css">
	<#include "/head.ftl"/>
	<script>
	 var editor=CKEDITOR.replace('TextArea1');
	 
	 
	</script>
	<div class="content">
		<div class="tab">
			
			<div class="box-header">
					<a title="返回" class="btn btn-setting" onclick="back(this)">
						<i class="iconfont icon-undo"></i>
					</a>
					<a title="刷新" class="btn btn-setting" onclick="refresh(this)">
							<i class="iconfont icon-refresh"></i>
					</a>
			</div>
			<form class="add_post" method="post">
				<table class="public">
					<tr>
						<td>帖子标题：</td>
						<td colspan="3" id="post_title"><input name="discuss.title" class="title" placeholder="帖子标题（必填）"><a id="post_title"></a></td>
					</tr>
					<tr>
						<td>帖子类型：</td>
						<td>
							<select class="write_style" name="discuss.type" id="discuss_style"> 
							<#list type as type>
								<option value="${type.value}">${type.name}</option> 
							</#list>
							</select>
						</td>
						
						<td>帖子状态：</td>
						<td>
							<select class="write_status" name="discuss.status"> 
								<#list status as sta>
								<option value="${sta.value}">${sta.name}</option> 
							</#list>
							</select>
						</td>
					</tr>
				
					<!-- 活动 -->
					<tr id="active">
						<td>活动地点：</td>
						<td colspan="3" id="active_address"><input name="address" class="title" placeholder="活动地点（必填）"></td>
						
					</tr>
					<tr id="active1">
						<td>开始时间：</td>
						<td id="active_start_time"><input class="active_start_time Wdate" name="startTime" type="text" id="startDate" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd', minDate: '${.now}' })" placeholder="活动开始时间（必填）"></td>
						<td>结束时间：</td>
						<td id="active_end_time"><input class="active_end_time Wdate" name="endTime" type="text"  id="endDate" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd', minDate:'#F{$dp.$D(\'startDate\')}'})" placeholder="活动结束时间（必填）"></td>
					</tr>
					<!-- 投票 -->
					<tr id="vote">
						<td>投票类型：</td>
						<td>
							<select class="write_vote" name="style"> 
								<option value="0">单选</option> 
								<#list 1..8 as x>
									<option value="${x}">多选，最多${x+1}项</option>
								</#list>
							</select>
						</td>
						<td>截止时间：</td>
						<td id="vote_time"><input class="address_time" name="vendTime" type="text" onfocus="WdatePicker({minDate:'%y-%M-%d'})" placeholder="投票截止时间（必填）"></td>
					</tr>
				</table>
					<div class="vote_option">
					    <div class="detail_description">填写选项内容</div>
							<div class="options" id="options">
								<div class="option" date="1"><input type="text" name="voteContents[0].vcontent" placeholder="选项1"></div>
								<div class="option" date="2"><input type="text" name="voteContents[1].vcontent" placeholder="选项2"></div>
								<div class="add_option" onclick="add_option()">
									<span><i class="iconfont icon-jia"></i></span>添加选项
								</div>
						</div>
					</div>
					
				<div class="write_editor" style="width: 74%; margin: 0 auto;">
					<textarea id="TextArea1" cols="20" rows="2" class="ckeditor" name="content"></textarea> 
								
					<textarea style="display: none;" name="discuss.content"  id="write_editor"></textarea>
				</div>
				<div class="add_discuss">
				<input type="hidden" name="discuss.user" value="${userinfo.id}">
				<input name="save" type="submit" id="sure" value="确定" class="button" onclick="add_discuss()">
				</div>
			</form>
			
		</div>
	</div>
	
</body>
</html>